export const getCityName = (list: any, id: string) => {
  //通过城市id到省市名称
  let arr:any = [];
  for (let i = 0; i < list.length; i++) {
    if (list[i].children) {
      for (let j = 0; j < list[i].children.length; j++) {
        if (list[i].children[j].value == id) {
          arr.push(list[i].label, list[i].children[j].label);
        }
      }
    }
  }
  return arr.join("-");
};
export const getCityId = (list:any, id:any) => {
  let arr:any = [];
  //通过城市id递归找到省市id并存入数组中
  for (let i = 0; i < list.length; i++) {
    if (list[i].children) {
      for (let j = 0; j < list[i].children.length; j++) {
        if (list[i].children[j].value == id) {
          arr = [list[i].value, id];
        }
      }
    }
  }
  return arr;
};


